import Router from '@koa/router';
import authController from '@/controllers/auth.controller';
import { authMiddleware } from '@/middleware/authMiddleware';
import UploadController  from '@/controllers/upload.controller';
import EnumController from '@/controllers/enum.controller'
import menuRouter from './menu.router';
import articleRouter from './article.router';
import categoriesRouter from './categories.router';
import bannerRouter from './banner.router';
import tableInfoRouter from './tableInfo.router';
import fieldInfoRouter from './fieldInfo.router';
import dictRouter from './dict.router';
const router = new Router();
router.use(authMiddleware)
router.post('/checkLogin', authController.checkLogin);

router.post('/upload/image', UploadController.uploadImage);

router.post('/enum/get', EnumController.getEnums);


router.use(menuRouter.routes(), menuRouter.allowedMethods())
router.use(articleRouter.routes(), articleRouter.allowedMethods())
router.use(categoriesRouter.routes(), categoriesRouter.allowedMethods())
router.use(bannerRouter.routes(), bannerRouter.allowedMethods())
router.use(tableInfoRouter.routes(),tableInfoRouter.allowedMethods())
router.use(fieldInfoRouter.routes(),fieldInfoRouter.allowedMethods())
router.use(dictRouter.routes(),dictRouter.allowedMethods())
export default router;